home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue39 / construc / visitbob_tlb.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-10-06  |  13.6 KB  |  310 lines

  1. unit VisitBob_TLB;
  2.  
  3. // ************************************************************************ //
  4. // WARNING                                                                  //
  5. // -------                                                                  //
  6. // The types declared in this file were generated from data read from a     //
  7. // Type Library. If this type library is explicitly or indirectly (via      //
  8. // another type library referring to this type library) re-imported, or the //
  9. // 'Refresh' command of the Type Library Editor activated while editing the //
  10. // Type Library, the contents of this file will be regenerated and all      //
  11. // manual modifications will be lost.                                       //
  12. // ************************************************************************ //
  13.  
  14. // PASTLWTR : $Revision:   1.11.1.63.1.0.1.0  $
  15. // File generated on 10/6/98 3:38:02 PM from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: C:\USR\BOB\MAGAZINE\DELPHI.MAG\#39\src\VisitBob.tlb
  19. // IID\LCID: {C4C61526-5D0E-11D2-85BA-000000000000}\0
  20. // Helpfile: 
  21. // HelpString: VisitBob Library
  22. // Version:    1.0
  23. // ************************************************************************ //
  24.  
  25. interface
  26.  
  27. uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL;
  28.  
  29. // *********************************************************************//
  30. // GUIDS declared in the TypeLibrary. Following prefixes are used:      //
  31. //   Type Libraries     : LIBID_xxxx                                    //
  32. //   CoClasses          : CLASS_xxxx                                    //
  33. //   DISPInterfaces     : DIID_xxxx                                     //
  34. //   Non-DISP interfaces: IID_xxxx                                      //
  35. // *********************************************************************//
  36. const
  37.   LIBID_VisitBob: TGUID = '{C4C61526-5D0E-11D2-85BA-000000000000}';
  38.   IID_IVisitorTrackingX: TGUID = '{C4C61527-5D0E-11D2-85BA-000000000000}';
  39.   DIID_IVisitorTrackingXEvents: TGUID = '{C4C61529-5D0E-11D2-85BA-000000000000}';
  40.   CLASS_VisitorTrackingX: TGUID = '{C4C6152B-5D0E-11D2-85BA-000000000000}';
  41.  
  42. // *********************************************************************//
  43. // Declaration of Enumerations defined in Type Library                  //
  44. // *********************************************************************//
  45. // TxActiveFormBorderStyle constants
  46. type
  47.   TxActiveFormBorderStyle = TOleEnum;
  48. const
  49.   afbNone = $00000000;
  50.   afbSingle = $00000001;
  51.   afbSunken = $00000002;
  52.   afbRaised = $00000003;
  53.  
  54. // TxPrintScale constants
  55. type
  56.   TxPrintScale = TOleEnum;
  57. const
  58.   poNone = $00000000;
  59.   poProportional = $00000001;
  60.   poPrintToFit = $00000002;
  61.  
  62. // TxMouseButton constants
  63. type
  64.   TxMouseButton = TOleEnum;
  65. const
  66.   mbLeft = $00000000;
  67.   mbRight = $00000001;
  68.   mbMiddle = $00000002;
  69.  
  70. // TxBiDiMode constants
  71. type
  72.   TxBiDiMode = TOleEnum;
  73. const
  74.   bdLeftToRight = $00000000;
  75.   bdRightToLeft = $00000001;
  76.   bdRightToLeftNoAlign = $00000002;
  77.   bdRightToLeftReadingOnly = $00000003;
  78.  
  79. type
  80.  
  81. // *********************************************************************//
  82. // Forward declaration of interfaces defined in Type Library            //
  83. // *********************************************************************//
  84.   IVisitorTrackingX = interface;
  85.   IVisitorTrackingXDisp = dispinterface;
  86.   IVisitorTrackingXEvents = dispinterface;
  87.  
  88. // *********************************************************************//
  89. // Declaration of CoClasses defined in Type Library                     //
  90. // (NOTE: Here we map each CoClass to its Default Interface)            //
  91. // *********************************************************************//
  92.   VisitorTrackingX = IVisitorTrackingX;
  93.  
  94.  
  95. // *********************************************************************//
  96. // Interface: IVisitorTrackingX
  97. // Flags:     (4416) Dual OleAutomation Dispatchable
  98. // GUID:      {C4C61527-5D0E-11D2-85BA-000000000000}
  99. // *********************************************************************//
  100.   IVisitorTrackingX = interface(IDispatch)
  101.     ['{C4C61527-5D0E-11D2-85BA-000000000000}']
  102.     function Get_Visible: WordBool; safecall;
  103.     procedure Set_Visible(Value: WordBool); safecall;
  104.     function Get_AutoScroll: WordBool; safecall;
  105.     procedure Set_AutoScroll(Value: WordBool); safecall;
  106.     function Get_AutoSize: WordBool; safecall;
  107.     procedure Set_AutoSize(Value: WordBool); safecall;
  108.     function Get_AxBorderStyle: TxActiveFormBorderStyle; safecall;
  109.     procedure Set_AxBorderStyle(Value: TxActiveFormBorderStyle); safecall;
  110.     function Get_Caption: WideString; safecall;
  111.     procedure Set_Caption(const Value: WideString); safecall;
  112.     function Get_Color: OLE_COLOR; safecall;
  113.     procedure Set_Color(Value: OLE_COLOR); safecall;
  114.     function Get_Font: IFontDisp; safecall;
  115.     procedure _Set_Font(const Value: IFontDisp); safecall;
  116.     procedure Set_Font(var Value: IFontDisp); safecall;
  117.     function Get_KeyPreview: WordBool; safecall;
  118.     procedure Set_KeyPreview(Value: WordBool); safecall;
  119.     function Get_PixelsPerInch: Integer; safecall;
  120.     procedure Set_PixelsPerInch(Value: Integer); safecall;
  121.     function Get_PrintScale: TxPrintScale; safecall;
  122.     procedure Set_PrintScale(Value: TxPrintScale); safecall;
  123.     function Get_Scaled: WordBool; safecall;
  124.     procedure Set_Scaled(Value: WordBool); safecall;
  125.     function Get_Active: WordBool; safecall;
  126.     function Get_DropTarget: WordBool; safecall;
  127.     procedure Set_DropTarget(Value: WordBool); safecall;
  128.     function Get_HelpFile: WideString; safecall;
  129.     procedure Set_HelpFile(const Value: WideString); safecall;
  130.     function Get_DoubleBuffered: WordBool; safecall;
  131.     procedure Set_DoubleBuffered(Value: WordBool); safecall;
  132.     function Get_Enabled: WordBool; safecall;
  133.     procedure Set_Enabled(Value: WordBool); safecall;
  134.     function Get_BiDiMode: TxBiDiMode; safecall;
  135.     procedure Set_BiDiMode(Value: TxBiDiMode); safecall;
  136.     function Get_Cursor: Smallint; safecall;
  137.     procedure Set_Cursor(Value: Smallint); safecall;
  138.     property Visible: WordBool read Get_Visible write Set_Visible;
  139.     property AutoScroll: WordBool read Get_AutoScroll write Set_AutoScroll;
  140.     property AutoSize: WordBool read Get_AutoSize write Set_AutoSize;
  141.     property AxBorderStyle: TxActiveFormBorderStyle read Get_AxBorderStyle write Set_AxBorderStyle;
  142.     property Caption: WideString read Get_Caption write Set_Caption;
  143.     property Color: OLE_COLOR read Get_Color write Set_Color;
  144.     property Font: IFontDisp read Get_Font write _Set_Font;
  145.     property KeyPreview: WordBool read Get_KeyPreview write Set_KeyPreview;
  146.     property PixelsPerInch: Integer read Get_PixelsPerInch write Set_PixelsPerInch;
  147.     property PrintScale: TxPrintScale read Get_PrintScale write Set_PrintScale;
  148.     property Scaled: WordBool read Get_Scaled write Set_Scaled;
  149.     property Active: WordBool read Get_Active;
  150.     property DropTarget: WordBool read Get_DropTarget write Set_DropTarget;
  151.     property HelpFile: WideString read Get_HelpFile write Set_HelpFile;
  152.     property DoubleBuffered: WordBool read Get_DoubleBuffered write Set_DoubleBuffered;
  153.     property Enabled: WordBool read Get_Enabled write Set_Enabled;
  154.     property BiDiMode: TxBiDiMode read Get_BiDiMode write Set_BiDiMode;
  155.     property Cursor: Smallint read Get_Cursor write Set_Cursor;
  156.   end;
  157.  
  158. // *********************************************************************//
  159. // DispIntf:  IVisitorTrackingXDisp
  160. // Flags:     (4416) Dual OleAutomation Dispatchable
  161. // GUID:      {C4C61527-5D0E-11D2-85BA-000000000000}
  162. // *********************************************************************//
  163.   IVisitorTrackingXDisp = dispinterface
  164.     ['{C4C61527-5D0E-11D2-85BA-000000000000}']
  165.     property Visible: WordBool dispid 1;
  166.     property AutoScroll: WordBool dispid 2;
  167.     property AutoSize: WordBool dispid 3;
  168.     property AxBorderStyle: TxActiveFormBorderStyle dispid 4;
  169.     property Caption: WideString dispid -518;
  170.     property Color: OLE_COLOR dispid -501;
  171.     property Font: IFontDisp dispid -512;
  172.     property KeyPreview: WordBool dispid 5;
  173.     property PixelsPerInch: Integer dispid 6;
  174.     property PrintScale: TxPrintScale dispid 7;
  175.     property Scaled: WordBool dispid 8;
  176.     property Active: WordBool readonly dispid 9;
  177.     property DropTarget: WordBool dispid 10;
  178.     property HelpFile: WideString dispid 11;
  179.     property DoubleBuffered: WordBool dispid 12;
  180.     property Enabled: WordBool dispid -514;
  181.     property BiDiMode: TxBiDiMode dispid 13;
  182.     property Cursor: Smallint dispid 14;
  183.   end;
  184.  
  185. // *********************************************************************//
  186. // DispIntf:  IVisitorTrackingXEvents
  187. // Flags:     (0)
  188. // GUID:      {C4C61529-5D0E-11D2-85BA-000000000000}
  189. // *********************************************************************//
  190.   IVisitorTrackingXEvents = dispinterface
  191.     ['{C4C61529-5D0E-11D2-85BA-000000000000}']
  192.     procedure OnActivate; dispid 1;
  193.     procedure OnClick; dispid 2;
  194.     procedure OnCreate; dispid 3;
  195.     procedure OnDblClick; dispid 4;
  196.     procedure OnDestroy; dispid 5;
  197.     procedure OnDeactivate; dispid 6;
  198.     procedure OnKeyPress(var Key: Smallint); dispid 10;
  199.     procedure OnPaint; dispid 15;
  200.   end;
  201.  
  202.  
  203. // *********************************************************************//
  204. // OLE Control Proxy class declaration
  205. // Control Name     : TVisitorTrackingX
  206. // Help String      : VisitorTrackingX Control
  207. // Default Interface: IVisitorTrackingX
  208. // Def. Intf. DISP? : No
  209. // Event   Interface: IVisitorTrackingXEvents
  210. // TypeFlags        : (34) CanCreate Control
  211. // *********************************************************************//
  212.   TVisitorTrackingXOnKeyPress = procedure(Sender: TObject; var Key: Smallint) of object;
  213.  
  214.   TVisitorTrackingX = class(TOleControl)
  215.   private
  216.     FOnActivate: TNotifyEvent;
  217.     FOnClick: TNotifyEvent;
  218.     FOnCreate: TNotifyEvent;
  219.     FOnDblClick: TNotifyEvent;
  220.     FOnDestroy: TNotifyEvent;
  221.     FOnDeactivate: TNotifyEvent;
  222.     FOnKeyPress: TVisitorTrackingXOnKeyPress;
  223.     FOnPaint: TNotifyEvent;
  224.     FIntf: IVisitorTrackingX;
  225.     function  GetControlInterface: IVisitorTrackingX;
  226.   protected
  227.     procedure CreateControl;
  228.     procedure InitControlData; override;
  229.   public
  230.     property  ControlInterface: IVisitorTrackingX read GetControlInterface;
  231.     property Visible: WordBool index 1 read GetWordBoolProp write SetWordBoolProp;
  232.     property Active: WordBool index 9 read GetWordBoolProp;
  233.     property DropTarget: WordBool index 10 read GetWordBoolProp write SetWordBoolProp;
  234.     property HelpFile: WideString index 11 read GetWideStringProp write SetWideStringProp;
  235.     property DoubleBuffered: WordBool index 12 read GetWordBoolProp write SetWordBoolProp;
  236.     property Enabled: WordBool index -514 read GetWordBoolProp write SetWordBoolProp;
  237.     property BiDiMode: TOleEnum index 13 read GetTOleEnumProp write SetTOleEnumProp;
  238.   published
  239.     property AutoScroll: WordBool index 2 read GetWordBoolProp write SetWordBoolProp stored False;
  240.     property AutoSize: WordBool index 3 read GetWordBoolProp write SetWordBoolProp stored False;
  241.     property AxBorderStyle: TOleEnum index 4 read GetTOleEnumProp write SetTOleEnumProp stored False;
  242.     property Caption: WideString index -518 read GetWideStringProp write SetWideStringProp stored False;
  243.     property Color: TColor index -501 read GetTColorProp write SetTColorProp stored False;
  244.     property Font: TFont index -512 read GetTFontProp write SetTFontProp stored False;
  245.     property KeyPreview: WordBool index 5 read GetWordBoolProp write SetWordBoolProp stored False;
  246.     property PixelsPerInch: Integer index 6 read GetIntegerProp write SetIntegerProp stored False;
  247.     property PrintScale: TOleEnum index 7 read GetTOleEnumProp write SetTOleEnumProp stored False;
  248.     property Scaled: WordBool index 8 read GetWordBoolProp write SetWordBoolProp stored False;
  249.     property Cursor: Smallint index 14 read GetSmallintProp write SetSmallintProp stored False;
  250.     property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
  251.     property OnClick: TNotifyEvent read FOnClick write FOnClick;
  252.     property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
  253.     property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
  254.     property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
  255.     property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
  256.     property OnKeyPress: TVisitorTrackingXOnKeyPress read FOnKeyPress write FOnKeyPress;
  257.     property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
  258.   end;
  259.  
  260. procedure Register;
  261.  
  262. implementation
  263.  
  264. uses ComObj;
  265.  
  266. procedure TVisitorTrackingX.InitControlData;
  267. const
  268.   CEventDispIDs: array [0..7] of DWORD = (
  269.     $00000001, $00000002, $00000003, $00000004, $00000005, $00000006,
  270.     $0000000A, $0000000F);
  271.   CTFontIDs: array [0..0] of DWORD = (
  272.     $FFFFFE00);
  273.   CControlData: TControlData = (
  274.     ClassID: '{C4C6152B-5D0E-11D2-85BA-000000000000}';
  275.     EventIID: '{C4C61529-5D0E-11D2-85BA-000000000000}';
  276.     EventCount: 8;
  277.     EventDispIDs: @CEventDispIDs;
  278.     LicenseKey: nil;
  279.     Flags: $0000001D;
  280.     Version: 300;
  281.     FontCount: 1;
  282.     FontIDs: @CTFontIDs);
  283. begin
  284.   ControlData := @CControlData;
  285. end;
  286.  
  287. procedure TVisitorTrackingX.CreateControl;
  288.  
  289.   procedure DoCreate;
  290.   begin
  291.     FIntf := IUnknown(OleObject) as IVisitorTrackingX;
  292.   end;
  293.  
  294. begin
  295.   if FIntf = nil then DoCreate;
  296. end;
  297.  
  298. function TVisitorTrackingX.GetControlInterface: IVisitorTrackingX;
  299. begin
  300.   CreateControl;
  301.   Result := FIntf;
  302. end;
  303.  
  304. procedure Register;
  305. begin
  306.   RegisterComponents('ActiveX',[TVisitorTrackingX]);
  307. end;
  308.  
  309. end.
  310.